package com.bj.zspace.boot.server.service;

import com.bjzspace.proto.HelloProto;
import com.bjzspace.proto.HelloServiceGrpc;
import io.grpc.stub.StreamObserver;
import net.devh.boot.grpc.server.service.GrpcService;

@GrpcService
public class HelloServiceImpl extends HelloServiceGrpc.HelloServiceImplBase{

    @Override
    public void hello(HelloProto.HelloRequest request, StreamObserver<HelloProto.HelloResponse> responseObserver) {
        System.out.println("service receive:" + request.getName());
        HelloProto.HelloResponse response = HelloProto.HelloResponse.newBuilder().setResult("service ack").build();
        responseObserver.onNext(response);
        responseObserver.onCompleted();
    }
}
